package com.cn.action;



import com.cn.dao.LeibieDao;
import com.cn.dao.NewsDao;
import com.cn.entity.Leibie;
import com.cn.entity.News;
import com.opensymphony.xwork2.Action;
public class NewsAddAction implements Action{
	News news;

	public News getNews() {
		return news;
	}

	public void setNews(News news) {
		this.news = news;
	}
    String leibie;
    
    
    
	public String getLeibie() {
		return leibie;
	}

	public void setLeibie(String leibie) {
		this.leibie = leibie;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		LeibieDao ld=new LeibieDao();
		Leibie lb=ld.selectLeibie(leibie);
				
		String date="2013-7-23";
		news.setDate(date);
		news.setLeibie(lb);
		NewsDao nd=new NewsDao();
		nd.addNews(news);
		
		
		
		
		
		
		
		
		return "success";
	}
	
	

}
